<?php


namespace app\admin\model;


use think\Model;
use think\model\concern\SoftDelete;

class Customer extends Model
{

    use SoftDelete;
    protected $name = 'customer';


    //附件关联关系
    public function CustomerAppendix(){
    	return $this->hasMany(CustomerAppendix::class,'customer_id');
    }
    //城市关联关系
    public function CustomerCity(){
    	return $this->belongsTo(CustomerCity::class,'city_id');
    }
    //产品关联系
    public function CustomerIntention(){
    	return $this->belongsTo(CustomerIntention::class,'intention_id');
    }
 	//客户状态关联系
    public function CustomerStatus(){
    	return $this->belongsTo(CustomerStatus::class,'customer_status_id');
    }
	//成熟度关联系
    public function CustomerRipe(){
    	return $this->belongsTo(CustomerRipe::class,'maturity_id');
    }
	//负责人关联系
    public function PersonInCharge(){
    	return $this->belongsTo(Admin::class,'person_in_charge_id');
    }    

	//录入人关联系
    public function EntryPerson(){
    	return $this->belongsTo(Admin::class,'entry_person_id');
    }        
}